/*
 * @Author: WangShuai 1830773767@qq.com
 * @Date: 2025-06-20 09:49:55
 * @LastEditors: WangShuai 1830773767@qq.com
 * @LastEditTime: 2025-06-29 17:56:36
 * @FilePath: \shangyitong\src\router\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE:""
 */
import { createRouter, createWebHistory } from 'vue-router'

//createRouter 方法用于创建路由器实例,可以管理多个路由
const router = createRouter({
    //路由的模式设置
    history: createWebHistory(),
    routes: [
        {
            path: "/home",
            component: () => import('@/pages/home/index.vue'),
            meta:{
                title:'首页'
            }
        },
        // 医院一级路由
        {
            path: "/hospital",
            component: import('@/pages/hospital/index.vue'),
            redirect: "/hospital/register",
            children: [
                {
                    path: 'register',
                    component: import("@/pages/hospital/register/index.vue"),
                    meta:{
                        title:'预约挂号'
                    }
                },
                {
                    path: 'detail',
                    component: () =>import("@/pages/hospital/detail/index.vue"),
                    meta:{
                        title:'医院详情'
                    }
                },
                {
                    path: 'notice',
                    component: () =>import("@/pages/hospital/notice/index.vue"),
                    meta:{
                        title:'预约通知'
                    }
                },
                {
                    path: 'close',
                    component: () =>import("@/pages/hospital/close/index.vue"),
                    meta:{
                        title:'停诊信息'
                    }
                },
                {
                    path: 'search',
                    component: () =>import("@/pages/hospital/search/index.vue"),
                    meta:{
                        title:'查询与取消'
                    }
                },
                //预约挂号详情页面路由
                {
                    path: 'register_step1',
                    component: () => import('@/pages/hospital/register/register_step1.vue'),
                    meta:{
                        title:'预约第一步'
                    }
                },
                //预约挂号详情页面路由2
                {
                    path: 'register_step2',
                    component: () => import('@/pages/hospital/register/register_step2.vue'),
                    meta:{
                        title:'预约第二步'
                    }
                },
            ]
        },
        //会员中心一级路由 
        {
            path: "/user",
            component: () => import('@/pages/user/index.vue'),
            children: [
                {
                    path: "certification",//实名认证
                    component: () => import('@/pages/user/certification/index.vue'),
                    meta:{
                        title:'实名认证'
                    }
                },
                {
                    path: "order",//挂号订单
                    component: () => import('@/pages/user/order/index.vue'),
                    meta:{
                        title:'挂号订单'
                    }
                },
                {
                    path: "patient",//就诊人管理
                    component: () => import('@/pages/user/patient/index.vue'),
                    meta:{
                        title:'就诊人管理'
                    }
                },
                {
                    path: "profile",//帐号信息
                    component: () => import('@/pages/user/profile/index.vue'),
                    meta:{
                        title:'帐号信息'
                    }
                },
                {
                    path: "freedback",//意见反馈
                    component: () => import('@/pages/user/freedback/index.vue'),
                    meta:{
                        title:'意见反馈'
                    }
                },
            ]
        },
        {
            path: '/wxlogin',
            component: () => import('@/pages/wxlogin/index.vue'),
            
        },
        {
            path: "/",
            redirect: "/home"//路由重定向
        },
    ],
    //滚动行为:控制滚动条位置
    scrollBehavior() {
        return {
            left: 0,
            top: 0
        }
    }
})




export default router